<?php

/**
 * Infante_per form base class.
 *
 * @package    form
 * @subpackage infante_per
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $
 */
class BaseInfante_perForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'numhistoria' => new sfWidgetFormPropelSelect(array('model' => 'Historia', 'add_empty' => false)),
      'parentesco'  => new sfWidgetFormInput(),
      'nombre'      => new sfWidgetFormInput(),
      'apellido'    => new sfWidgetFormInput(),
      'edad'        => new sfWidgetFormInput(),
      'sexo'        => new sfWidgetFormInput(),
      'encuesta'    => new sfWidgetFormInput(),
      'cod_familia' => new sfWidgetFormPropelSelect(array('model' => 'Datos', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Infante_per', 'column' => 'id', 'required' => false)),
      'numhistoria' => new sfValidatorPropelChoice(array('model' => 'Historia', 'column' => 'id')),
      'parentesco'  => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'nombre'      => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'apellido'    => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'edad'        => new sfValidatorInteger(array('required' => false)),
      'sexo'        => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'encuesta'    => new sfValidatorInteger(array('required' => false)),
      'cod_familia' => new sfValidatorPropelChoice(array('model' => 'Datos', 'column' => 'cedula')),
    ));

    $this->widgetSchema->setNameFormat('infante_per[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Infante_per';
  }


}
